package com.garmin.gh.apps.wellnessmonitor.dao;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.garmin.gh.apps.wellnessmonitor.dao.h2.WellnessDao;
import com.garmin.gh.apps.wellnessmonitor.domain.SummaryData;

@Component
public class LoadSummaryDataDao
{
    private static final Logger logger = LoggerFactory.getLogger(LoadSummaryDataDao.class);
    @Autowired
    WellnessDao wellnessDao;

    public void savePingData(String summary_domain, String model, String consumerKey, String userAccessToken,
        long timeStamp, String data_lob)
    {
        SummaryData summaryData = new SummaryData();
        summaryData.setSummaryDomain(summary_domain);
        summaryData.setModel(model);
        summaryData.setConsumerKey(consumerKey);
        summaryData.setUserAccessToken(userAccessToken);
        summaryData.setTimeStamp(timeStamp);
        summaryData.setDataLob(data_lob);
        logger.info("saving ping summarydata in to wellnessrepo");
        wellnessDao.save(summaryData);
    }

    public void savePushData(String summaryDomain, String model, String consumerKey, long timeStamp,
        String dataLob)
    {
        SummaryData summaryData = new SummaryData();
        summaryData.setSummaryDomain(summaryDomain);
        summaryData.setModel(model);
        summaryData.setConsumerKey(consumerKey);
        summaryData.setTimeStamp(timeStamp);
        summaryData.setDataLob(dataLob);
        logger.info("saving push summarydata in to wellnessrepo");
        wellnessDao.save(summaryData);
    }

}
